package com.cooldatasoft.taskManager.user.gui;

import org.springframework.beans.factory.annotation.Configurable;

import com.cooldatasoft.domain.model.DocumentType;
import com.cooldatasoft.domain.model.Project;
import com.cooldatasoft.taskManager.component.DocumentationView;
import com.cooldatasoft.taskManager.component.GuideView;
import com.cooldatasoft.taskManager.component.ProjectProgressView;
import com.cooldatasoft.taskManager.component.SourceControlView;
import com.vaadin.annotations.AutoGenerated;
import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.TabSheet;

@SuppressWarnings("serial")
@Configurable(preConstruction = true)
public class UserProjectsView extends CustomComponent{

	@AutoGenerated
	private AbsoluteLayout mainLayout;
	@AutoGenerated
	private TabSheet tab;
	
	/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */

	

	/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */

	

	/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */

	

	/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */

	

	/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */

	

	/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */

	

	/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */

	

	/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */

	private LeftPanel leftPanel;
	
	private Project myCurrentProject;

	public LeftPanel getLeftPanel() {
		return leftPanel;
	}

	public void setLeftPanel(LeftPanel leftPanel) {
		this.leftPanel = leftPanel;
	}

	public UserProjectsView(Project currentProject) {
		this.myCurrentProject = currentProject;
		buildMainLayout();
		setCompositionRoot(mainLayout);
	}

	@AutoGenerated
	private AbsoluteLayout buildMainLayout() {
		// common part: create layout
		mainLayout = new AbsoluteLayout();
		mainLayout.setImmediate(false);
		mainLayout.setWidth("100%");
		mainLayout.setHeight("100%");
		mainLayout.setMargin(false);
		
		// top-level component properties
		setWidth("100.0%");
		setHeight("100.0%");
		
		// tabSheet_2
		tab = buildTabSheet_2();
		mainLayout.addComponent(tab, "top:0.0px;left:0.0px;");
		
		return mainLayout;
	}

	@AutoGenerated
	private TabSheet buildTabSheet_2() {
		// common part: create layout
		tab = new TabSheet();
		tab.setImmediate(true);
		tab.setWidth("100.0%");
		tab.setHeight("100.0%");
		
		ProjectProgressView projectProgressView = new ProjectProgressView(myCurrentProject);
		tab.addTab(projectProgressView, "Current project", null);
		
		DocumentationView docView = new DocumentationView(myCurrentProject);
		tab.addTab(docView, "Documentation", null);
		
		GuideView userGuideView = new GuideView(myCurrentProject, DocumentType.USER_GUIDE);
		tab.addTab(userGuideView, "User guide", null);
			
		GuideView systemGuideView = new GuideView(myCurrentProject, DocumentType.SYSTEM_GUIDE);
		tab.addTab(systemGuideView, "System guide", null);

		SourceControlView sourceControlView = new SourceControlView(myCurrentProject);
		tab.addTab(sourceControlView, "Source control", null);
		
		return tab;
	}

}
